package org.hzero.business;

import org.hzero.core.base.BaseConstants;
import org.springframework.util.Assert;

/**
 * @ClassName: WorkflowKeyUtil
 * @Description: 构造工作流业务主键
 * @author: tianhao.luo@hand-china.com
 * @date: 2020/9/19  14:05
 */
public final class KnifeWorkflowKeyUtil {

    /**
     * 构建工作流业务主键
     * @param tClass 启动工作流时，headerId对应的实体类
     * @param headerId 申请单头id
     * @param <T> 占位符
     * @return 流程主键
     */
    public static <T> String createBusinessKey(Class<T> tClass, Long headerId){
        Assert.notNull(headerId,"单据头id不能为空！");
        return tClass.getSimpleName()+ BaseConstants.Symbol.LOWER_LINE+headerId;
    }
}
